<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>test</title>
</head>
<body>
	<button>取消</button>
	<script type="text/javascript" src="lib/zepto.min.js"></script>
	<script type="text/javascript">
		
		var btn = document.getElementsByTagName("button")[0];
		request({
			type: "get",
			data: {show: "0"},
			port: "/test/getMsg"}, true)
		btn.onclick = function(){
			request({
			type: "get",
			data: {show: "0"},
			port: "/test/getMsg"}, false);
		}
		
		var request_long;
		function request(xhr, cancel){
			var url = "http://qtt.tunnel.qydev.com" + xhr.port;
			if(cancel){
				request_long = $.ajax({
					type: xhr.type,
					url: url,
					data: xhr.data,
					dataType: "jsonp",
					success: function(data){
						$.hideLoading();
						success(data);
					}
				});
			}else{
				request_long.abort();
			}
		}
	</script>
</body>
</html>